package com.nomito.minimito.service.impl;


import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nomito.minimito.common.utils.PageUtils;
import com.nomito.minimito.common.utils.Query;

import com.nomito.minimito.dao.ImMsgDao;
import com.nomito.minimito.entity.ImMsgEntity;
import com.nomito.minimito.service.ImMsgService;


@Service("imMsgService")
public class ImMsgServiceImpl extends ServiceImpl<ImMsgDao, ImMsgEntity> implements ImMsgService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<ImMsgEntity> page = this.page(
                new Query<ImMsgEntity>().getPage(params),
                new QueryWrapper<ImMsgEntity>()
        );

        return new PageUtils(page);
    }

//    @Override
//    public List<Long> getUnReadMsgList(Long acceptUserId) {
//        return baseMapper.getUnReadMsgList(acceptUserId);
//    }

    /**
     * 批处理更新消息为已签收
     * @param msgIdList
     */
    @Override
    public void updateMsgSigned(List<Long> msgIdList) {
        baseMapper.batchUpdateMsgSigned(msgIdList);
    }



}